#!/bin/sh

gen_icon() {
    file_name=$1
    img_size=$2
    res_folder=$3

    echo Converting misc/$file_name.png to res/$res_folder/$file_name.png
    convert -resize $img_size -background transparent misc/$file_name.png res/$res_folder/$file_name.png
}

gen_app_icon() {
    file_name=$1

    gen_icon $file_name 96x96 drawable-xhdpi
    gen_icon $file_name 72x72 drawable-hdpi
    gen_icon $file_name 48x48 drawable
    gen_icon $file_name 36x36 drawable-ldpi
}

gen_app_icon icon

convert -resize 512x512 -background transparent misc/icon.png misc/icon512.png